package com.shop.controller.admin;
import com.shop.model.ProductCategory;
import com.shop.model.Product;
package com.shop.controller.admin;

public class Main {
    public static void main(String[] args) {
        ProductCategory electronics = new ProductCategory("Electronics");
        ProductCategory clothing = new ProductCategory("Clothing");

        Product laptop = new Product("Laptop", 999.99);
        Product tShirt = new Product("T-Shirt", 19.99);

        electronics.addProduct(laptop);
        clothing.addProduct(tShirt);

        System.out.println("添加商品后的分类信息：");
        System.out.println(electronics);
        System.out.println(clothing);

        electronics.disable();
        System.out.println("\n禁用 Electronics 分类后尝试添加商品：");
        electronics.addProduct(new Product("Mouse", 29.99));

        electronics.enable();
        System.out.println("\n启用 Electronics 分类后尝试添加商品：");
        electronics.addProduct(new Product("Mouse", 29.99));

        electronics.removeProduct(laptop);
        clothing.removeProduct(tShirt);

        System.out.println("\n删除商品后的分类信息：");
        System.out.println(electronics);
        System.out.println(clothing);

        Product newProduct = new Product("Keyboard", 49.99);
        electronics.addProduct(newProduct);
        newProduct.disable();
        System.out.println("\n禁用商品后的信息：");
        System.out.println(electronics);
    }
}